
#pragma once

#include <Arduino.h>

#include "oled_basic_v2.hpp"


namespace oled_basic {

    /**
     * @brief 让绘图类适配Arduino 的Print 接口
     *
     */
    template <typename MonoBasicType>
    class MonoPrint : public Print {
       private:
        MonoBasicType &_mb;

       public:
        MonoPrint(MonoBasicType &mb) : _mb(mb) {}

        virtual size_t write(uint8_t ch) override {
            _mb.put_char(ch);
            return 1;
        };
        
        // 部分兼容U8G2 的坐标系统
        void setCursor(uint8_t x, uint8_t y) {
            // TODO
        }
    };

}  // namespace oled_basic